import request from '@/config/axios'

export interface objs{
  orderId:number,
  voList:Array<any>
}
export interface test{
    pageNo: 1,
    pageSize: 10,
    id: null,
    mobile: null,
    status: null,
    nickname: null,
    avatar: null,
    name: null,
    userType: null,
    remark: null,
    censusRegister: null,
    registeredHk: null,
    referrer: null,
    age: null,
    sex: null,
    birthday: null,
    levelId: null,
    groupId: null,
    agentId: null,
    agentName: null,
    warrantId: null,
    warrantName: null,
    isHome: null,
    wealthValue: null,
    openId: null
}

// 查询用户信息列表
export const getUsersPage = async (params) => {

    return await request.get({ url: `/hutai/client/page`, params })
}
// 查询用户业务员详情
export const getSalesmanDetails = async (params) => {

    return await request.get({ url: `/hutai/client/getUserInfo?id=`+params })
}

//查询订单详情
export const getOrderInfoById = async (params) => {
  return await request.get({ url: `/hutai/order/common-list-info?orderId=`+params })
}

// 业务员、权证查询订单详情
export const getSalesmanWarrantOrderInfo = async (params) => {
  return await request.get({ url: `/hutai/order/salesman-warrant-list-info?orderId=`+params })
}


//查询总待跟进客户
export const getAgentWMyFollowUpUser = async (params) => {

    return await request.get({ url: `/hutai/statistics/getAgentWMyFollowUpUser?userId=`+params })
}
//查当月已跟进客户
export const getMyMonthFollowUpUser = async (params) => {
    return await request.get({ url: `/hutai/statistics/getAWUpUser?userId=`+params})
}
//查当月已成交订单
export const getMonthCjNumber = async (params) => {
    return await request.get({ url: `/hutai/statistics/getMonthCjNumber?userId=`+params})
}
//查当月已成交订单
export const getMonthCjMoney = async (params) => {
    return await request.get({ url: `/hutai/statistics/getMonthCjMoney?userId=`+params})
}
//查他的推荐人
export const getHeRecommend = async (params) => {
    return await request.get({ url: `/hutai/client/getHeRecommend?userId=`+params})
}
//查我的推荐人
export const getMiRecommend = async (params) => {
    return await request.get({ url: `/hutai/client/getMiRecommend?userId=`+params})
}
//查财富值
export const getWealthRecordList = async (params) => {
    return await request.get({ url: `/hutai/client/getWealthRecordList?userId=`+params})
}


//删除
export const deleteUser = async (id) => {
  return await request.post({ url: `/hutai/userdb/delete?id=`+id})
}

export const updateIsWork = async (id) => {
  return await request.post({ url: `/hutai/userdb/updateIsWork?id=`+id})
}

//禁用
export const forbiddenUser = async (id) => {
  return await request.post({ url: `/hutai/userdb/forbidden?id=`+id})
}

export const getUserOneList = async () => {
  return await request.get({ url: `/hutai/userdb/getUserOneList`})
}

//获得客户用户分页
export const getUserPages = async (pageNo,pageSize,userType,name,mobile) => {
  return await request.get({ url: `/hutai/client/page?pageNo=${pageNo}&pageSize=${pageSize}&userType=${userType}&name=${name}&mobile=${mobile}`})
}

//检查类目列表

export const getPublicitySelectListByTypesName = async (id,orderId) => {
  return await request.get({ url: `/hutai/publicity-type/getPublicitySelectListByTypesName?id=`+id+"&orderId="+orderId})
}


export const getAgentPublicitySelectListByTypesName = async (id,orderId) => {
  return await request.get({ url: `/hutai/publicity-type/getAgentPublicitySelectListByTypesName?id=`+id+"&orderId="+orderId})
}


export const getPublicitySelectListByClassName = async (id: number) => {
  return await request.get({ url: `/hutai/formula/get/`+id})
}

//单子驳回

export const reject = async (data) => {
  return await request.post({ url: '/hutai/order/agent/reject', data })
}

//保存资料
export const saveData = async (data: objs) => {
  return await request.post({ url: '/hutai/userdb/salesmanCreate', data })
}
//转权证
export const toWarrant = async (data) => {
  return await request.post({ url: '/hutai/userdb/data/transfer-warrant', data })
}
//权证查询客户资料列表
export const getInformation = async (data) => {
  return await request.get({ url: `/hutai/userdb/dataList?id=${data}`})
}

//权证资料驳回
export const cantPass = async (data) => {
  return await request.put({ url: '/hutai/userdb/data/verify',data})
}

//获得订单完善资料列表
export const getZiliao = async (data) => {
  return await request.get({ url: `/ht/orderProcessRecord/dataList?id=${data}`})
}

//业务员资料-产品准入匹配
export const getCheckProductAccess = async (id) => {
  return await request.get({ url: `/hutai/order/getCheckProductAccess?orderId=`+id})
}

//保存更新身份证号
export const subUserData = async (data) => {
  return await request.post({ url: '/hutai/userdb/update/idCard',data})
}
